//
//  HDSelectedMonth.m
//  MirkoLibTest
//
//  Created by Mirko on 2017/2/13.
//  Copyright © 2017年 Mirko. All rights reserved.
//

#import "HDSelectedMonth.h"

@implementation HDSelectedMonth

-(instancetype) initSelectedMonth:(NSString *) startMonth endMonth:(NSString *) endMonth
{
    self = [super init];
    if (self) {
        _selectStart = startMonth;
        _selectEnd = endMonth;
//        _monthCount = count;
    }
    return self;
}

-(NSTimeInterval) getTimeStampFromString:(NSString *) timeString
{
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat: @"yyyy-MM"];
    NSDate *destDate= [dateFormatter dateFromString:timeString];
    NSTimeInterval interval = [destDate timeIntervalSince1970];
    return interval;
}

-(NSTimeInterval) eTimeStamp
{
    return [self getTimeStampFromString:self.selectStart];
}

-(NSTimeInterval) sTimeStamp
{
    return [self getTimeStampFromString:self.selectEnd];
}



@end
